<?php
class Const_LeaveType {

    const LEAVE_TYPE_CHIDAO       = 1;//迟到
    const LEAVE_TYPE_ZAOTUI       = 2;//早退
    const LEAVE_TYPE_GONGCHU      = 3;//公出
    const LEAVE_TYPE_CHUCHA       = 4;//出差
    const LEAVE_TYPE_SHIJIA       = 5;//事假
    const LEAVE_TYPE_BINGJIA      = 6;//病假
    const LEAVE_TYPE_NIANJIA      = 7;//年假
    const LEAVE_TYPE_SANGJIA      = 8;//丧假
    const LEAVE_TYPE_HUNJIA       = 9;//婚假
    const LEAVE_TYPE_CHANJIAN     = 10;//产检
    const LEAVE_TYPE_CHANQIANJIA  = 11;//产前假
    const LEAVE_TYPE_CHANJIA      = 12;//产假
    const LEAVE_TYPE_PEICHANGJIA  = 13;//陪产假
    const LEAVE_TYPE_QUEQIN       = 14;//缺勤


    const LEAVE_STATUS_AUDIT      = 1;//未审核
    const LEAVE_STATUS_PASS       = 2;//已批准
    const LEAVE_STATUS_OVERRULE   = 3;//已驳回
    const LEAVE_STATUS_CANCEL     = 4;//已撤销

    const KQ_AM_STATUS_1          = 1;//迟到
    const KQ_AM_STATUS_3          = 3;//上午缺勤
    const KQ_AM_STATUS_5          = 5;//正常

    const KQ_PM_STATUS_2          = 2;//早退
    const KQ_PM_STATUS_4          = 4;//下午缺勤
    const KQ_PM_STATUS_6          = 6;//正常
    public static function kq_status_to_leave_status($kq_status){
        $data = array(
                1=>1,
                2=>2,
                3=>14,
                4=>14,
                5=>20,
                6=>21
        );
        return $data[$kq_status];
    }
    /**
     * 获取考勤对应名称
     * @param int $id
     * @return string name
     */
    public static function get_kq_name($id){
        $data = array(
                '1'=>'迟到',
                '2'=>'早退',
                '3'=>'上午缺勤',
                '4'=>'下午缺勤',
                '5'=>'正常',
                '6'=>'正常'
        );
        return $data[$id];
    }
    /**
     * 获取请假状态对应名称
     * @param int $id
     * @return string name
     */
    public static function get_leave_status_name($id){
        $data = array(
                '1'=>'未审核',
                '2'=>'已批准',
                '3'=>'已驳回',
                '4'=>'已撤销',
        );
        return $data[$id];
    }
    /**
     * 获取请假对应名称
     * @param int $id
     * @return string name
     */
    public static function get_leave_name($id){
        $data = array(
                '1'=>'迟到',
                '2'=>'早退',
                '3'=>'公出',
                '4'=>'出差',
                '5'=>'事假',
                '6'=>'病假',
                '7'=>'年假',
                '8'=>'丧假',
                '9'=>'婚假',
                '10'=>'产检',
                '11'=>'产前假',
                '12'=>'产假',
                '13'=>'陪产假',
                '14'=>'缺勤',
        );
        return $data[$id];
    }
}